import {Component, Input} from '@angular/core';
import {NavController} from "ionic-angular";
import {Platform} from 'ionic-angular';
import {Output, EventEmitter} from "@angular/core";
/**
 * Generated class for the PlateItemComponent component.
 *
 * See https://angular.io/api/core/Component for more info on Angular
 * Components.
 */
@Component({
  selector: 'plate-item',
  templateUrl: 'plate-item.html'
})
export class PlateItemComponent {
  @Input() itemData;
  @Output() private childOuter = new EventEmitter();

  constructor(public platform: Platform, public navCtrl: NavController) {
    console.log('Hello PlateItemComponent Component');
  }

  clickChildOne(event) {
    console.log('点击第1项');
    this.navCtrl.push('ReportdetailPage', {plateItemId: '1010', item: this.itemData, index: this.itemData.indexManagement.dataindex});
    event.stopPropagation();
    // 子组件主动发送数据
    // this.childOuter.emit("我是子组件的1数据");
    // event.stopPropagation();
  }

  clickChildTwo(event) {
    console.log('点击第2项');
    this.navCtrl.push('ReportdetailPage', {plateItemId: '1015', item: this.itemData, index: this.itemData.indexManagement.dataindex});
    event.stopPropagation();
    // 子组件主动发送数据
    // this.childOuter.emit("我是子组件的2数据");
    // event.stopPropagation();
  }
}
